<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>模板引擎检测</title>
	<script  src="template.js"></script>
	<style type="text/css">
		ul{list-style: none;}
	</style>
</head>
<body>
<div id="content"></div>
	<script id="test" type="text/html">	
		<h1>{{title}}</h1>
		<ul>
		    {{each list as value i}}
		        <li> {{i + 1}} ：{{value}}</li>
		    {{/each}}
		</ul>	
	</script>
	<script>
		var data = {
		    title: '检测',		   
		    list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他']
		};
		var html = template('test', data);
		document.getElementById('content').innerHTML = html;
	</script>
</body>
</html>